home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig21_09.jar / Ch21 / Fig21_09 / fig21_09.cpp
C/C++ Source or Header  |  1997-11-09  |  735b  |  26 lines

  1. // Fig. 21.9: fig21_09.cpp
  2. // Demonstrating operator keywords.
  3. #include <iostream>
  4. #include <iomanip>
  5. #include <iso646.h>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.    int a = 8, b = 22;
  11.  
  12.    cout << boolalpha 
  13.         <<   "   a and b: " << ( a and b )
  14.         << "\n    a or b: " << ( a or b )
  15.         << "\n     not a: " << ( not a )
  16.           << "\na not_eq b: " << ( a not_eq b )
  17.         << "\na bitand b: " << ( a bitand b )
  18.         << "\na bit_or b: " << ( a bitor b )
  19.         << "\n   a xor b: " << ( a xor b )
  20.         << "\n   compl a: " << ( compl a )
  21.         << "\na and_eq b: " << ( a and_eq b )
  22.         << "\n a or_eq b: " << ( a or_eq b )
  23.         << "\na xor_eq b: " << ( a xor_eq b ) << endl;
  24.         
  25.    return 0;
  26. }